﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeFile="CompInfoAdd1.aspx.cs"
    Inherits="Manager_CompInfoAdd" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>无标题页</title>
    <style type="text/css">
        .mright
        {
            margin-right: 5px;
        }
        .datecontainer .x-form-field-trigger-wrap
        {
            margin-right: 5px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <ext:PageManager ID="PageManager1" runat="server" AjaxLoadingType="mask" AutoSizePanelID="sfCompInfo" />
    <ext:SimpleForm ID="sfCompInfo" runat="server" BodyPadding="5px" ShowHeader="false"
        LabelAlign="right" FooterBarAlign="center" AutoScroll="true">
        <Items>
            <ext:HiddenField ID="hfCompId" runat="server">
            </ext:HiddenField>
            <ext:TextBox ID="txtName" runat="server" Label="信息标题" Required="true" ShowRedStar="true">
            </ext:TextBox>
            <ext:TextBox ID="txtCode" runat="server" Label="编号" Required="true" ShowRedStar="true">
            </ext:TextBox>
            <ext:TextArea ID="txtKeywords" runat="server" Label="优化站点关键词" Height="40">
            </ext:TextArea>
            <ext:TextArea ID="txtDescription" runat="server" Label="优化站点描述" Height="40">
            </ext:TextArea>
            <ext:DatePicker ID="dpEndDate" runat="server" Label="报名截止日期" EmptyText="只有报名类的才需要填写！！" Required="true" DateFormatString="yyyy-MM-dd HH:mm:ss" Hidden="true">
            </ext:DatePicker>
            <ext:CheckBox ID="cboxStatus" runat="server" Text="显示/隐藏" Label="菜单显示" Hidden="true">
            </ext:CheckBox>
            <ext:Panel ID="Panel3" runat="server" ShowHeader="false" Layout="Column" ShowBorder="false"
                CssClass="x-form-item datecontainer" Hidden="true">
                <Items>
                    <ext:Label ID="Label6" Width="100px" runat="server" Text="更新正文：" Hidden="true">
                    </ext:Label>
                    <ext:Button ID="btnLoadData" runat="server" Text="加载数据" OnClick="btnLoadData_Click" Hidden="true">
                    </ext:Button>
                    <ext:Label ID="Label7" runat="server" Text="（若不更新数据，则无需重新加载数据！)" Hidden="true">
                    </ext:Label>
                </Items>
            </ext:Panel>
            <ext:ContentPanel ID="ContentPanel1" runat="server" AutoWidth="true" Title="文章内容">
                <textarea name="UEditor1" id="UEditor1"></textarea>
            </ext:ContentPanel>
        </Items>
        <Toolbars>
            <ext:Toolbar ID="Toolbar1" runat="server" Position="footer">
                <Items>
                    <ext:Button ID="btnSubmit" runat="server" Text="资料保存" Icon="systemsave" ValidateForms="sfCompInfo"
                        OnClick="btnSubmit_Click">
                    </ext:Button>
                    <ext:Button ID="btnReset" runat="server" Text="重 置" Icon="reload">
                    </ext:Button>
                </Items>
            </ext:Toolbar>
        </Toolbars>
    </ext:SimpleForm>
    </form>

    <script type="text/javascript">
    window.UEDITOR_HOME_URL = "<%= ResolveUrl("~/ueditor/") %>";
    </script>

    <script type="text/javascript" src="../ueditor/editor_config.js"></script>

    <script type="text/javascript" src="../ueditor/editor_all.js"></script>

    <script type="text/javascript">
    var editor;
    function onReady() {
        editor = new UE.ui.Editor({
            initialFrameWidth: '100%',
            initialFrameHeight: 240,
            minFrameHeight: 240,
            autoFloatEnabled: false,
            focus: true
        });
        editor.render("UEditor1");
    }


    // 提交数据之前同步到表单隐藏字段
    X.util.beforeAjaxPostBackScript = function () {
        editor.sync();
    };

    // 更新编辑器内容
    function updateUEditor(content) {
        window.setTimeout(function () {
            editor.setContent(content);
        }, 100);
    }
</script>

</body>
</html>
